package com.starleague.battletech.unit;

import java.util.Map;

public abstract class AbstractBattletechUnitEngine
        extends AbstractBattletechUnitComponent
        implements IBattletechUnitEngine
{
    private BattletechUnitEngineType engineType;
    private int engineRating;

    protected AbstractBattletechUnitEngine(AbstractBattletechUnit battletechUnit,
                                           AbstractWeight weight,
                                           BattletechUnitEngineType engineType,
                                           int engineRating)
    {
        super(battletechUnit, weight);
        this.engineRating = engineRating;
        this.engineType = engineType;
    }

    protected AbstractBattletechUnitEngine()
    {
        //
    }

    @Override
    public boolean isHittable()
    {
        return true;
    }

    @Override
    public BattletechUnitEngineType getEngineType()
    {
        return this.engineType;
    }

    @Override
    public int getEngineRating()
    {
        return this.engineRating;
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("engineType", this.engineType);
        infoPropertyMap.put("engineRating", this.engineRating);
        return infoPropertyMap;
    }
}
